package cn.web.management.web.servlet.inform.admin;

import cn.web.management.service.general.AdminQuery;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

@WebServlet(name = "queryAllPersonServlet", value = "/queryAllPersonServlet")
public class queryAllPersonServlet extends HttpServlet {
    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        doPost(req, resp);
    }

    /**
     * @description: 内容3，查询用户员工号号姓名，工资录入下拉栏
     * @paramName: [req, resp]
     * @paramType: [javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse]
     * @returnType: void
     */
    @Override
    protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        resp.setContentType("application/json;charset=UTF-8");
        AdminQuery adminQuery = new AdminQuery();
        String allPersonEmployno = adminQuery.findAllPersonEmployno();
        resp.getWriter().write(allPersonEmployno);
    }
}
